<?php
	// Check for installer.
	require_once("jara_config.php");
	if(defined("JARA_NOT_INSTALLED")) {
		header("Location: _install.php");
		exit;
	}
	require_once("auth_fns.php");
	require_once("db_fns.php");
	require_once("exceptions.php");
	
	require_once("templating_fns.php");
	
	// Basic systems check
	try {
		jara_db_query("select * from jara_posts");
	}
	catch(JaraDatabaseException $ex) {
		echo "<!doctype html><html><head><title>Jara - General Error</title><style type='text/css'>html{background:#ccc;}body{background:#fff;font:11px Verdana, sans-serif;margin:1em auto;width:760px;border:1px solid #000;padding:5px 10px;</style></head><body><h1>Jara: General Error</h1><p>Jara could not connect to the database:</p><blockquote>".$ex->getSqlMsg()."</blockquote><p>Jara may have to be re-installed. Please consult the person who set up your Jara installation.</p><p style=\"text-align: center; border-top: 1px solid #ccc; padding-top: 10px;\">Copyright &copy; <a href=\"http://www.xantiss.co.cc/\">Xanti Software and Services</a> 2009-2010.</p></body></html>";
		exit;
	}
?>